@import '../var';
@import '../control';

$input-unit-width: 3.25em;

@mixin input-with-unit() {
  -webkit-appearance: none;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  box-shadow: none;
  display: inline-flex;
  font-size: 1rem;
  height: 2em;
  justify-content: flex-start;
  line-height: 1;
  position: relative;
  vertical-align: top;
  padding: 0;
  .input {
    padding-right: $input-unit-width;
  }
  .unit {
    right: 0;
    height: $control-height;
    position: absolute;
    top: 0;
    width: $input-unit-width;
    // z-index: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-left: 1px solid $border;
    cursor: pointer;
    &.is-disabled {
      cursor: not-allowed;
      color: $text-light;
      border-left-color: transparent;
    }
  }
}

.length-input {
  @include input-with-unit;
}

.speed-input {
  @include input-with-unit;
}
